package com.sprouting.personal.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import lombok.Data;

import javax.validation.constraints.Null;

/**
 * 随手记
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2022/12/20 16:26
 */
@Data
@TableName("ps_jot_down")
public class PsJotDown extends BaseModel {

    /**
     * 主键
     */
    @TableId
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    private String id;
    /**
     * 隶属用户
     * @see User#getId()
     */
    private String userId;
    /**
     * 是否选中
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#YES 被选中
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#NO 未选中
     */
    private Integer checkValue;
    /**
     * 内容
     */
    @CheckLength(min = 1, max = 1000, message = "内容长度超过最大限制")
    @CheckNotNull(message = "请输入内容")
    private String content;
    /**
     * 颜色
     * @see com.sprouting.personal.interfaces.common.Constant.MarkColor
     */
    private Integer markColor;
}
